<template>
	<page-loading :show="list">
		<view style="background: rgb(246,246,246);" v-if="list">
			<view class="" v-show="selectLog">
				<view class="logo">
					<view class="logo-icon2" @click="uploadAvatar" v-if="roleId !== 0">
						<image class="logo-icon" :src="logoUrl" mode="aspectFit" v-if="logoUrl"></image>
						<image class="logo-icon" src="https://files.yzsheng.com/bussiness/imgs/shangcuan.png" v-else></image>
					</view>
					<view class="logo-icon2" v-else>
						<image class="logo-icon" :src="logoUrl" mode="aspectFit" v-if="logoUrl"></image>
						<image class="logo-icon" src="https://files.yzsheng.com/bussiness/imgs/shangcuan.png" v-else></image>
					</view>
					<view class="info">
						
						<!-- 店铺名 -->
						<view class="store-name" v-if="roleId !== 0">
							<view style="width:200rpx;" >
								<u-input v-model="StoreName"  :custom-style="{'color':'#333','font-size':'30rpx','font-weight':'bold'}" @blur="updateCompanyInfo" placeholder="请设置店铺名称" placeholderStyle="color-000" inputAlign="center" :trim="true"></u-input>
							</view>
							<view @click="open"><i-icon icon="iconqiyebianji" size="24rpx"></i-icon></view>
						</view>
						<view class="company-name" v-else>{{ StoreName }}</view>
						<view class="store-name">{{ list.companyName }}</view>
						<view class="set-time">
							<view><i-icon icon="iconyingyezhizhao" size="24rpx"></i-icon></view>
							企业创建于{{ list.addTime }}
							<view><i-icon icon="iconyingyezhizhao" size="24rpx"></i-icon></view>
						</view>
					</view>
				</view>
				<view class="main">
					<view class="box">
						<view class="line" @click="goPage(1)">
							<view class="name">
								<i-icon icon="iconjingjifuwushang" class="mr12" size="28rpx" color="rgb(253,216,43)"></i-icon>
								成员
							</view>
							<view class="main">
								{{ list.memberCount }}人
								<u-icon name="arrow-right"></u-icon>
							</view>
						</view>
						<view class="list">
							<view class="li" @click="goInfo(item)" v-for="(item, index) in menberList" :key="index">
								<!-- <template> -->
								<view class="iconssdd" v-if="item.isRegister">
									<!-- 头像 -->
									<image :src="item.headImg + '!user'" mode="aspectFit" v-if="item.headImg"></image>
									<image v-else src="https://files.yzsheng.com/AccountDefaultImg/HeadPortrait.png!user"></image>
								</view>
								<view class="iconssdd" v-else><image src="https://files.yzsheng.com/AccountDefaultImg/defaultImg.png"></image></view>
								<!-- </template> -->
								<view class="name" v-if="item.userName">{{ item.userName | cutString(10) }}</view>
								<view v-else>未命名</view>
								<view class="gread" v-if="item.isRegister">
									<text>{{ item.roleName === '超级管理员' ? '超管' : item.roleName }}</text>
								</view>
								<view class="gread" v-else>
									<text>未注册</text>
								</view>
							</view>
							<view class="li" @click="goPage(3)" v-if="roleId !== 0">
								<view class="icon"><i-icon icon="icontianjia1" size="90rpx" color="rgb(208,208,208)"></i-icon></view>
								<view class="name">邀请</view>
							</view>
							<view class="li" @click="goYg" v-if="roleId === 0">
								<view class="icon"><i-icon icon="icontianjia1" size="90rpx" color="rgb(208,208,208)"></i-icon></view>
								<view class="name">邀请</view>
							</view>
						</view>
					</view>
					<!-- 成员审核权限 -->
					<view class="box">
						<view class="line" @click="goMenber" v-if="roleId !== 0">
							<view class="name">成员审核</view>
							<view class="icon"></view>
							<view class="tag" v-if="list.applyCount !== '0'">{{ list.applyCount }}</view>
						</view>
					</view>
					<view class="box">
						<view class="line flex flex-jc-sb" @click="goPage(2)">
							<view class="name">
								<i-icon icon="iconshouhuodizhi" class="mr12" color="rgb(252,212,36)" size="38rpx"></i-icon>
								收货地址
							</view>
							<view style="text-align: right;" class="flex">
								<view class="tag" v-if="addNumber !== 0">
									<text>{{ addNumber }}</text>
								</view>
								<!-- <view style="background: #EB5C02;width: 28rpx;text-align: center;height: 44rpx;line-height: 44rpx;border-radius: 22rpx;font-size: 26rpx;color: #fff;"><text>{{addNumber}}</text></view> -->
								<view><u-icon name="arrow-right"></u-icon></view>
							</view>
						</view>
					</view>

					<!-- 描述 -->
					<view class="box">
						<view class="line">
							<view class="name">
								<i-icon icon="iconmiaoshu" class="mr12" color="rgb(252,212,36)" size="38rpx"></i-icon>
								描述
							</view>
						</view>

						<view class="text-area" v-if="roleId !== 0">
							<textarea placeholder="请对企业进行简要描述" :disabled="discshow" @input="descInput" maxlength="150" placeholder-class="placeholder" v-model="Reason" />
							<view class="countNum">
								<text style="color: #EB5C02;">{{ countNum }}</text>
								/150
							</view>
						</view>
						<view class="text-area placeholder" style="margin: 12rpx 12rpx 12rpx 36rpx;" v-else>{{ Reason }}</view>
					</view>

					<view class="box">
						<view class="line">
							<view class="name">
								<i-icon icon="iconqiye" class="mr12" size="38rpx" color="rgb(252,212,36)"></i-icon>
								企业信息
							</view>
						</view>

						<view class="company-info">
							<view class="li adress">
								<view class="title">公司全称</view>
								<view class="con" :style="list.companyName.length > 14 ? 'line-height: 48rpx;' : ''">
									<!-- <input type="text" :disabled="true" :value="list.companyName" /> -->
									{{ list.companyName }}
								</view>
							</view>

							<view class="li adress">
								<view class="title">企业类型</view>
								<view class="con" :style="list.storeType.length > 14 ? 'line-height: 48rpx;' : ''">{{ list.storeType | formatStoreType }}</view>
							</view>

							<view class="li adress">
								<view class="title">注册地址</view>
								<view class="con" style="line-height:48rpx;">
									<!-- <textarea  v-text="Address"/> -->
									{{ Address }}
								</view>
							</view>
						</view>
					</view>
					<!-- <view class="box">
						<view class="line yingye">
							<view class="name">
								<i-icon icon="iconyingyezhizhao" size="38rpx" color="rgb(252,212,36)"></i-icon>
								营业执照
							</view>
							<view class="license">
								<image :src="list.license" mode="aspectFit"></image>
							</view>
						</view>
					</view> -->

					<!-- 照片 -->
					<view class="box">
						<view class="line">
							<view class="name">
								<i-icon icon="iconqiye" class="mr12" size="38rpx" color="rgb(252,212,36)"></i-icon>
								店铺照片
							</view>
						</view>
						<view class="picture">
							<upload-img
								v-model="doorPhoto"
								@del="navBack = true"
								@replace="navBack = true"
								@click="navBack = false"
								@out="navBack = true"
								title="门头照"
								:maxLength="1"
								width="206"
								height="137"
								:role="roleId"
							></upload-img>
							<upload-img
								v-model="environmentalPhoto"
								@del="navBack = true"
								@replace="navBack = true"
								@click="navBack = false"
								@out="navBack = true"
								title="环境照片"
								:maxLength="4"
								width="140"
								height="94"
								:role="roleId"
							></upload-img>
							<upload-img
								v-model="qualificationsPhoto"
								@del="navBack = true"
								@replace="navBack = true"
								@click="navBack = false"
								@out="navBack = true"
								:margin="18"
								title="资质证件"
								:maxLength="10"
								width="110"
								height="80"
								:role="roleId"
							></upload-img>
						</view>
					</view>
				</view>
				<u-toast ref="uToast" />
				<u-popup v-model="saveshow" class="u-text-center " mode="center" border-radius="20" width="540" height="350">
					<view class="popup_title">温馨提示</view>
					<view class="color-666 font-28 mt-10 pad-l-r-20">您当前编辑的内容未保存，请确认是否保存？</view>
					<view class="btnWrap">
						<view class="left" @click="closeAll">取消</view>
						<view class="right" @click="updateCompanyInfo(2)">保存</view>
					</view>
				</u-popup>
				<view style="height: 250rpx;"></view>
				<view class="footer" v-show="roleId !== 0"><button @click="updateCompanyInfo(2)">保存资料</button></view>
			</view>
			<view class="" v-show="!selectLog"><kps-image-cutter @ok="onok" @cancel="oncancle" :url="url" :fixed="true" :width="100" :height="100"></kps-image-cutter></view>
		</view>
	</page-loading>
</template>
<script src="./company.js"></script>
<style src="./company.scss" lang="scss"></style>
